<?php
//debug($members);
if (count($members)) {
    foreach ($members as $member) {
        if (!isset($member['Member']['id'])) {
            continue;
        }
        ?>
        <tr class='member_list_row' data-url="<?php echo $this->Html->url(array('controller' => 'organisation', 'action' => 'member_details', $member['Member']['id'])); ?>"
            data-member-id="<?php echo $member['Member']['id']; ?>" data-org-member-id="<?php echo $member['OrganisationMember']['id']; ?>" 
            data-member-phone-number='<?php echo isset($member['Member']['mobile_number']) ? $member['Member']['mobile_number'] : ''; ?>'>
            <td>
                <input class="checkbox" type="checkbox" value="<?php echo $member['Member']['id']; ?>" />
            </td>
            <td class="org_number"><?php echo $member['OrganisationMember']['organisation_no']; ?></td>
            <td class="member_name" data-first-name="<?php echo $member['Member']['first_name']; ?>" 
                data-last-name="<?php echo $member['Member']['last_name']; ?>"
                data-org-no="<?php echo $member['OrganisationMember']['organisation_no']; ?>">
                    <?php echo $member['Member']['last_name'] . ' ' . $member['Member']['first_name'] . ' ' . $member['Member']['middle_name']; ?>
            </td>
        </tr>
        <?php
    }
} else {
    ?>

    <div style='padding: 20px;'>
        <div class='alert alert-info'>
            No Records Found For Search Done
        </div>
    </div>
    <?php
}
